mergeSort:: (Ord a) => [a] -> [a]
mergeSort [] = []
mergeSort [x] = [x]
mergeSort xs = merge ys zs 
			   where
					ys = mergeSort (take half xs)
					zs = mergeSort (drop half xs)	
					half = div size 2 
					size = length xs

merge:: (Ord a) => [a] -> [a] -> [a]
merge [] [] = []
merge xs [] = xs
merge [] ys = ys
merge (x:xs) (y:ys) | x < y = [x] ++ merge xs (y:ys)
					| y < x = [y] ++ merge (x:xs) ys
					| otherwise = [x,y] ++ merge xs ys

(Node 1 [(Node 2 [(Node 5 [Nil])]),(Node 3 [Nil]),(Node 4 [Node 6 [Node 7 [Nil]]])])
